<template>
	<div class="slideBanner">
		<div class="slideBox">
			<div class="hd">
				<ul>
					<li class=""></li>
					<li class="on"></li>
					<li class=""></li>
				</ul>
			</div>
			<div class="bd">
				<ul>
					<li  v-for="item in contentList.slice(0, 3)">
						<a :href="Path + item.url" class="block_a">
							<img  :src="getImgPath((item.extend.singleImgUploadGnNp?.length ? item.extend.singleImgUploadGnNp[0].url : '') || item.headImag)" />
							<p class="h p_descripte_newsBanner_big">{{ item.title }}</p>
						</a>
					</li>
				</ul>
			</div>
			<!-- 下面是前/后按钮代码，如果不需要删除即可 -->
			
			<div class="swiperButton prev"><span class="iconfont icon-a-Leftarrow"></span></div>
			<div class="swiperButton swiperButton_right next"><span class="iconfont icon-a-Rightarrow"></span></div>
		</div>
		<div class="banner_right">
			<div v-for="item in contentList.slice(3, 5)" class="banner_right_item">
				<a :href="Path + item.url" class="block_a">
					<div class="img_contentain img_box">
						<img :src="getImgPath((item.extend.singleImgUploadGnNp?.length ? item.extend.singleImgUploadGnNp[0].url : '') || item.headImag)" class="img_pic box_radius_pic" />
					</div>
					<p class="h p_descripte">{{ item.title }}</p>
				</a>
			</div>
		</div>
	</div>
</template>
<script>
export default {
	components: {},
	data() {
		return {
			titleObj: {
				title: '推荐阅读',
				title_icon: 'icon-Refresh-one',
				actionName: '换一换'
			},
			titleObj_list: {
				title: '热点排行',
				title_icon: 'icon-Refresh-one',
				actionName: '换一换'
			},
			curentChannelId: '',
			query:GetQueryString(),
			Path:getRootPath(),
			contentList:[],
			imgPath:imgPath,
		};
	},
	mounted() {
		this.$nextTick(()=>{
			this.getContentOfChannel();
		})
	},
	methods: {
		initSlide() {
			jQuery('.slideBox').slide({ 
				prevCell:'.prev',
				nextCell:'.next', 
				mainCell:".bd ul",
				effect:"left",
				autoPlay:true
});
		},
		getContentOfChannel() {
			let param = {
				channelIdStr: this.query.id,
				pageNum: 1,
				pageSize: 6,
				typeIdStr: '1002',
				orderBy: 3,
			};
			contentApi.fetchContentOfChannel(param, res => {
				if (res.code == '00000 00000') {
					this.contentList = res.data.records;
          this.$nextTick(()=>{
						this.initSlide()
					})
				} else {
				}
			});
		},
		getImgPath(url){
			return imgPath(url);
		},
	}
};
</script>

<style scoped="scoped">
.slideBanner {
	display: flex;
	width: 1200px;
}
.slideBox {
	width: 840px;
	height: 473px;
	overflow: hidden;
	position: relative;
	border-radius: 4px;
	margin-right: 24px;
}
.slideBox .hd {
	height: 10px;
	overflow: hidden;
	position: absolute;
	right: 12px;
	bottom: 32px;
	z-index: 11;
}
.slideBox .hd ul {
	overflow: hidden;
	zoom: 1;
	float: left;
}
.slideBox .hd ul li {
	float: left;
	margin-right: 2px;
	width: 10px;
	height: 10px;
	background: #fff;
	cursor: pointer;
	border-radius: 10px;
	opacity: 0.5;
	margin-right: 12px;
}
.slideBox .hd ul li.on {
	opacity: 1;
}
.slideBox .bd {
	position: relative;
	height: 100%;
	z-index: 1;
}
.slideBox .bd li {
	zoom: 1;
	vertical-align: middle;
}
.slideBox .bd img {
	width: 840px;
	height: 473px;
	display: block;
}
.slideBox .p_descripte_newsBanner_big {
	padding: 24px;
	font-size: 18px;
	font-family: PingFang SC-Medium, PingFang SC;
	font-weight: 500;
	color: #ffffff;
	line-height: 26px;
	width: 400px;
	box-sizing: border-box;
	margin-top: -74px;
	position: relative;
	width: 400px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	position: relative;
	z-index: 1;
	height: 76px;
	width: 100%;
	background: linear-gradient(360deg, #111111 0%, rgba(17, 17, 17, 0) 100%);
}
.banner_right {
	display: flex;
	flex-direction: column;
	width: 336px;
}
.banner_right_item .img_contentain {
	width: 100%;
	height: 189px;
	border-radius: 4px 4px 0 0;
}
.banner_right_item:nth-of-type(1) {
	margin-bottom: 12px;
}
.p_descripte {
	width: 336px;
	height: 42px;
	background: #f8f8f8;
	line-height: 42px;
	border-radius: 0px 0px 4px 4px;
	padding: 0 16px;
	box-sizing: border-box;
}
.box_radius_pic {
	width: 100%;
	transition: all 1.3s;
}
.box_radius_pic:hover{
	transform: scale(1.2);
	
}
.slideBox:hover .swiperButton {
	display: flex;
}
.swiperButton {
	width: 56px;
	height: 56px;
	background: rgba(51,51,51,0.3);
	position: absolute;
	display: flex;
	justify-content: center;
	align-items: center;
	border-radius: 100%;
	top: calc(50% - 28px);
	left: 24px;
	z-index: 2;
	display: none;
}
.swiperButton:hover{
	background: rgba(51,51,51,1);
}
.swiperButton .iconfont {
	color: #fff;
	font-size: 48px;
	font-weight: 400;
	opacity: 1;
}
.slideBox .swiperButton_right {
	right: 24px;
	left: auto;
}
</style>
